/**
 * Created by wzq on 15-3-28.
 */

var mongodb = require('./mongodb.js');
var Schema = mongodb.Schema;

// create a schema
var adminSchema = new Schema({
    name: {
        type: String,
        require: true,
        unique: true
    },
    avatar: String,
    password: {
        type: String,
        require: true
    },
    email: {
        type: String,
        require: true,
        unique: true,
    },
    roleRight: {
        type: Number,
        default: 1
    },
    roleName: {
        type: String,
        default: 'app-admin'
    }
});

var Admin = mongodb.model('Admin', adminSchema);

exports = module.exports = Admin;